build: Use the appropriate symbol visibility annotation
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 22 Aug 2017 09:27:14 +0000 (10:27 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 22 Aug 2017 09:27:14 +0000 (10:27 +0100)
We cargo-culted this from Autotools, but GCC on Windows supports the
same __declspec syntax as MSVC. The only difference is the additional
flag needed for GCC-like compilers.

meson.build

index 158e5c871bd6f5173ec926e4f577618707950c38..52a080713a7a111777e0e08ecd3f234925c0c822 100644 (file)
@@ -279,10 +279,8 @@ endforeach
 if get_option('default_library') != 'static'
   if host_machine.system() == 'windows'
     cdata.set('DLL_EXPORT', true)
-    if cc.get_id() == 'msvc'
-      cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
-    else
-      cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
+    cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
+    if cc.get_id() != 'msvc'
       common_cflags += ['-fvisibility=hidden']
     endif
   else